﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class MasterPage_Adminitrator : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
      if (Session["User"] == null)
      {
        Response.Redirect("~/admin/Login.aspx");
      }
      else
      {
        ltNameLogin.Text = ((DAL.User)Session["User"]).Name;
        if(!Request.RawUrl.Contains("Error.aspx"))
        Session["url_back"] = Request.RawUrl;
      }
    }
  
    protected void linkLogout_Click(object sender, EventArgs e)
    {
      Session["User"] = null;
      Response.Redirect("~/admin/Login.aspx");
    }
}
